package burubaka.meta;

//@javax.annotation.Generated(value = { "slim3-gen", "@VERSION@" }, date = "2012-05-04 21:41:09")
/** */
public final class ResultHorseMeta extends org.slim3.datastore.ModelMeta<burubaka.model.ResultHorse> {

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<burubaka.model.ResultHorse, java.util.Date> createdDate = new org.slim3.datastore.CoreAttributeMeta<burubaka.model.ResultHorse, java.util.Date>(this, "createdDate", "createdDate", java.util.Date.class);

    /** */
    public final org.slim3.datastore.StringAttributeMeta<burubaka.model.ResultHorse> finishPoint = new org.slim3.datastore.StringAttributeMeta<burubaka.model.ResultHorse>(this, "finishPoint", "finishPoint");

    /** */
    public final org.slim3.datastore.StringAttributeMeta<burubaka.model.ResultHorse> horseName = new org.slim3.datastore.StringAttributeMeta<burubaka.model.ResultHorse>(this, "horseName", "horseName");

    /** */
    public final org.slim3.datastore.StringAttributeMeta<burubaka.model.ResultHorse> horseNameA = new org.slim3.datastore.StringAttributeMeta<burubaka.model.ResultHorse>(this, "horseNameA", "horseNameA");

    /** */
    public final org.slim3.datastore.StringAttributeMeta<burubaka.model.ResultHorse> horseNo = new org.slim3.datastore.StringAttributeMeta<burubaka.model.ResultHorse>(this, "horseNo", "horseNo");

    /** */
    public final org.slim3.datastore.StringAttributeMeta<burubaka.model.ResultHorse> jockey = new org.slim3.datastore.StringAttributeMeta<burubaka.model.ResultHorse>(this, "jockey", "jockey");

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<burubaka.model.ResultHorse, com.google.appengine.api.datastore.Key> key = new org.slim3.datastore.CoreAttributeMeta<burubaka.model.ResultHorse, com.google.appengine.api.datastore.Key>(this, "__key__", "key", com.google.appengine.api.datastore.Key.class);

    /** */
    public final org.slim3.datastore.StringAttributeMeta<burubaka.model.ResultHorse> sexAge = new org.slim3.datastore.StringAttributeMeta<burubaka.model.ResultHorse>(this, "sexAge", "sexAge");

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<burubaka.model.ResultHorse, java.lang.Long> version = new org.slim3.datastore.CoreAttributeMeta<burubaka.model.ResultHorse, java.lang.Long>(this, "version", "version", java.lang.Long.class);

    /** */
    public final org.slim3.datastore.StringAttributeMeta<burubaka.model.ResultHorse> waku = new org.slim3.datastore.StringAttributeMeta<burubaka.model.ResultHorse>(this, "waku", "waku");

    /** */
    public final org.slim3.datastore.StringAttributeMeta<burubaka.model.ResultHorse> weight = new org.slim3.datastore.StringAttributeMeta<burubaka.model.ResultHorse>(this, "weight", "weight");

    private static final ResultHorseMeta slim3_singleton = new ResultHorseMeta();

    /**
     * @return the singleton
     */
    public static ResultHorseMeta get() {
       return slim3_singleton;
    }

    /** */
    public ResultHorseMeta() {
        super("ResultHorse", burubaka.model.ResultHorse.class);
    }

    @Override
    public burubaka.model.ResultHorse entityToModel(com.google.appengine.api.datastore.Entity entity) {
        burubaka.model.ResultHorse model = new burubaka.model.ResultHorse();
        model.setCreatedDate((java.util.Date) entity.getProperty("createdDate"));
        model.setFinishPoint((java.lang.String) entity.getProperty("finishPoint"));
        model.setHorseName((java.lang.String) entity.getProperty("horseName"));
        model.setHorseNameA((java.lang.String) entity.getProperty("horseNameA"));
        model.setHorseNo((java.lang.String) entity.getProperty("horseNo"));
        model.setJockey((java.lang.String) entity.getProperty("jockey"));
        model.setKey(entity.getKey());
        model.setSexAge((java.lang.String) entity.getProperty("sexAge"));
        model.setVersion((java.lang.Long) entity.getProperty("version"));
        model.setWaku((java.lang.String) entity.getProperty("waku"));
        model.setWeight((java.lang.String) entity.getProperty("weight"));
        return model;
    }

    @Override
    public com.google.appengine.api.datastore.Entity modelToEntity(java.lang.Object model) {
        burubaka.model.ResultHorse m = (burubaka.model.ResultHorse) model;
        com.google.appengine.api.datastore.Entity entity = null;
        if (m.getKey() != null) {
            entity = new com.google.appengine.api.datastore.Entity(m.getKey());
        } else {
            entity = new com.google.appengine.api.datastore.Entity(kind);
        }
        entity.setProperty("createdDate", m.getCreatedDate());
        entity.setProperty("finishPoint", m.getFinishPoint());
        entity.setProperty("horseName", m.getHorseName());
        entity.setProperty("horseNameA", m.getHorseNameA());
        entity.setProperty("horseNo", m.getHorseNo());
        entity.setProperty("jockey", m.getJockey());
        entity.setProperty("sexAge", m.getSexAge());
        entity.setProperty("version", m.getVersion());
        entity.setProperty("waku", m.getWaku());
        entity.setProperty("weight", m.getWeight());
        entity.setProperty("slim3.schemaVersion", 1);
        return entity;
    }

    @Override
    protected com.google.appengine.api.datastore.Key getKey(Object model) {
        burubaka.model.ResultHorse m = (burubaka.model.ResultHorse) model;
        return m.getKey();
    }

    @Override
    protected void setKey(Object model, com.google.appengine.api.datastore.Key key) {
        validateKey(key);
        burubaka.model.ResultHorse m = (burubaka.model.ResultHorse) model;
        m.setKey(key);
    }

    @Override
    protected long getVersion(Object model) {
        burubaka.model.ResultHorse m = (burubaka.model.ResultHorse) model;
        return m.getVersion() != null ? m.getVersion().longValue() : 0L;
    }

    @Override
    protected void assignKeyToModelRefIfNecessary(com.google.appengine.api.datastore.AsyncDatastoreService ds, java.lang.Object model) {
    }

    @Override
    protected void incrementVersion(Object model) {
        burubaka.model.ResultHorse m = (burubaka.model.ResultHorse) model;
        long version = m.getVersion() != null ? m.getVersion().longValue() : 0L;
        m.setVersion(Long.valueOf(version + 1L));
    }

    @Override
    protected void prePut(Object model) {
    }

    @Override
    protected void postGet(Object model) {
    }

    @Override
    public String getSchemaVersionName() {
        return "slim3.schemaVersion";
    }

    @Override
    public String getClassHierarchyListName() {
        return "slim3.classHierarchyList";
    }

    @Override
    protected boolean isCipherProperty(String propertyName) {
        return false;
    }

    @Override
    protected void modelToJson(org.slim3.datastore.json.JsonWriter writer, java.lang.Object model, int maxDepth, int currentDepth) {
        burubaka.model.ResultHorse m = (burubaka.model.ResultHorse) model;
        writer.beginObject();
        org.slim3.datastore.json.Default encoder0 = new org.slim3.datastore.json.Default();
        if(m.getCreatedDate() != null){
            writer.setNextPropertyName("createdDate");
            encoder0.encode(writer, m.getCreatedDate());
        }
        if(m.getFinishPoint() != null){
            writer.setNextPropertyName("finishPoint");
            encoder0.encode(writer, m.getFinishPoint());
        }
        if(m.getHorseName() != null){
            writer.setNextPropertyName("horseName");
            encoder0.encode(writer, m.getHorseName());
        }
        if(m.getHorseNameA() != null){
            writer.setNextPropertyName("horseNameA");
            encoder0.encode(writer, m.getHorseNameA());
        }
        if(m.getHorseNo() != null){
            writer.setNextPropertyName("horseNo");
            encoder0.encode(writer, m.getHorseNo());
        }
        if(m.getJockey() != null){
            writer.setNextPropertyName("jockey");
            encoder0.encode(writer, m.getJockey());
        }
        if(m.getKey() != null){
            writer.setNextPropertyName("key");
            encoder0.encode(writer, m.getKey());
        }
        if(m.getSexAge() != null){
            writer.setNextPropertyName("sexAge");
            encoder0.encode(writer, m.getSexAge());
        }
        if(m.getVersion() != null){
            writer.setNextPropertyName("version");
            encoder0.encode(writer, m.getVersion());
        }
        if(m.getWaku() != null){
            writer.setNextPropertyName("waku");
            encoder0.encode(writer, m.getWaku());
        }
        if(m.getWeight() != null){
            writer.setNextPropertyName("weight");
            encoder0.encode(writer, m.getWeight());
        }
        writer.endObject();
    }

    @Override
    protected burubaka.model.ResultHorse jsonToModel(org.slim3.datastore.json.JsonRootReader rootReader, int maxDepth, int currentDepth) {
        burubaka.model.ResultHorse m = new burubaka.model.ResultHorse();
        org.slim3.datastore.json.JsonReader reader = null;
        org.slim3.datastore.json.Default decoder0 = new org.slim3.datastore.json.Default();
        reader = rootReader.newObjectReader("createdDate");
        m.setCreatedDate(decoder0.decode(reader, m.getCreatedDate()));
        reader = rootReader.newObjectReader("finishPoint");
        m.setFinishPoint(decoder0.decode(reader, m.getFinishPoint()));
        reader = rootReader.newObjectReader("horseName");
        m.setHorseName(decoder0.decode(reader, m.getHorseName()));
        reader = rootReader.newObjectReader("horseNameA");
        m.setHorseNameA(decoder0.decode(reader, m.getHorseNameA()));
        reader = rootReader.newObjectReader("horseNo");
        m.setHorseNo(decoder0.decode(reader, m.getHorseNo()));
        reader = rootReader.newObjectReader("jockey");
        m.setJockey(decoder0.decode(reader, m.getJockey()));
        reader = rootReader.newObjectReader("key");
        m.setKey(decoder0.decode(reader, m.getKey()));
        reader = rootReader.newObjectReader("sexAge");
        m.setSexAge(decoder0.decode(reader, m.getSexAge()));
        reader = rootReader.newObjectReader("version");
        m.setVersion(decoder0.decode(reader, m.getVersion()));
        reader = rootReader.newObjectReader("waku");
        m.setWaku(decoder0.decode(reader, m.getWaku()));
        reader = rootReader.newObjectReader("weight");
        m.setWeight(decoder0.decode(reader, m.getWeight()));
        return m;
    }
}